﻿@using NewLife;
@using NewLife.Web;
@using XCode;
@using NewLife.Cube.Extensions
@{
    var fact = ViewBag.Factory as IEntityFactory;
    var page = ViewBag.Page as Pager;

    var act = Context.Request.Path + "";
    if (act.IsNullOrEmpty()) { act = Url.Action("Index"); }

    var set = ViewBag.PageSetting as PageSetting ?? PageSetting.Global;
}

<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-container">
        @*@if (set.EnableAdd && !set.IsReadOnly && this.Has(PermissionFlags.Insert))*@

        @{
            var rv = page.GetRouteValue();
            <button class="layui-btn layui-btn-sm" data-url="@(rv+"/Add")" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm" data-url="@(rv+"/Add")" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm" data-url="@(rv+"/Add")" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm" data-url="@(rv+"/Add")" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm" data-url="@(rv+"/Add")" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm" data-url="@(rv+"/Add")" lay-event="add">添加</button>
            <button class="layui-btn layui-btn-sm" data-url="@(rv+"/Add")" lay-event="add">添加</button>
        }

        @*@if (set.EnableSelect)
            {
                <div class="form-group toolbar-batch">
                    @await Html.PartialAsync("_List_Toolbar_Batch")
                </div>
            }
            @await Html.PartialAsync("_List_Toolbar_Custom")
            <div class="pull-right form-group">
                @await Html.PartialAsync("_List_Search")
                @await Html.PartialAsync("_List_Toolbar_Search")
                @await Html.PartialAsync("_List_Toolbar_Adv")
            </div>*@
    </div>
    <div class="demoTable" style="position:absolute;right:120px;top:6px;width:255px;">
        @if (set.EnableKey)
        {
            <div class="layui-inline">
                <input class="layui-input" name="q" value="@Context.Request.GetRequestValue("q")" placeholder="搜索关键字" autocomplete="off">
            </div>
        }
        <button class="layui-btn layui-btn-sm" data-type="reload"><i class="layui-icon layui-icon-search"></i>查询</button>
    </div>
</script>